//
//  WBComposeMenuButton.swift
//  WBWeiBo
//
//  Created by 王斌 on 16/7/17.
//  Copyright © 2016年 王斌. All rights reserved.
//

import UIKit

class WBComposeMenuButton: UIButton {
    
    //  持有跳转的控制器模型
    var composeMenu:WBCompseMenu?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    private func setupUI(){
        
        titleLabel?.font = UIFont.systemFontOfSize(15)
        setTitleColor(UIColor.grayColor(), forState: .Normal)
        titleLabel?.textAlignment = .Center
    }
    
    // 重写hightlighted的属性
    override var highlighted:Bool{
        get{
            return false
        }
        set{
            
        }
    }
    
    
    //  调整子控件布局
    override func layoutSubviews() {
        super.layoutSubviews()
        
        //  设置子控件的宽高
        imageView?.y = 0
        imageView?.width = width
        imageView?.height = width
        
        titleLabel?.x = 0
        titleLabel?.y = width
        titleLabel?.width = width
        titleLabel?.height = height - width
    }

}







